import java.awt.Font;
import java.awt.LayoutManager;
import java.awt.Rectangle;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
/**
 * Allow User to Update Authorization
 * 
 *
 */
public class UpdateAuthorizationGui extends JPanel {

	private static final long serialVersionUID = 1L;
	private JLabel jlblTitle = null;
	private JLabel jlblUserName = null;
	public JTextField jtxtUserName = null;
	public JComboBox jcbxAut = null;
	private JLabel jlblAut = null;
	public JButton jbtnUpdate = null;
	public JButton jbtnBack = null;
	/**
	 * Create and initializes UpdateAuthorizationGui
	 */
	public UpdateAuthorizationGui() {
		// TODO Auto-generated constructor stub
		super();
		initialize();
	}

	public UpdateAuthorizationGui(LayoutManager arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public UpdateAuthorizationGui(boolean arg0) {
		super(arg0);
		// TODO Auto-generated constructor stub
		initialize();
	}

	public UpdateAuthorizationGui(LayoutManager arg0, boolean arg1) {
		super(arg0, arg1);
		// TODO Auto-generated constructor stub
		initialize();
	}

	/**
	 * initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		jlblAut = new JLabel();
		jlblAut.setBounds(new Rectangle(31, 117, 86, 29));
		jlblAut.setText("Authorization : ");
		jlblUserName = new JLabel();
		jlblUserName.setBounds(new Rectangle(31, 74, 72, 32));
		jlblUserName.setText("UserName:");
		jlblTitle = new JLabel();
		jlblTitle.setBounds(new Rectangle(86, 14, 236, 35));
		jlblTitle.setFont(new Font("Dialog", Font.BOLD, 18));
		jlblTitle.setText("Update User Authorization");
		this.setSize(350, 300);
		this.setLayout(null);
		this.add(jlblTitle, null);
		this.add(jlblUserName, null);
		this.add(getJtxtUserName(), null);
		this.add(getJcbxAut(), null);
		this.add(jlblAut, null);
		this.add(getJbtnUpdate(), null);
		this.add(getJbtnBack(), null);
	}

	/**
	 *initializes jtxtUserName	
	 * 	
	 * @return JTextField	
	 */
	private JTextField getJtxtUserName() {
		if (jtxtUserName == null) {
			jtxtUserName = new JTextField();
			jtxtUserName.setBounds(new Rectangle(147, 76, 152, 27));
		}
		return jtxtUserName;
	}

	/**
	 *initializes jcbxAut	
	 * 	
	 * @return JComboBox	
	 */
	private JComboBox getJcbxAut() {
		if (jcbxAut == null) {
			jcbxAut = new JComboBox();
			jcbxAut.setBounds(new Rectangle(151, 121, 153, 29));
			jcbxAut.addItem("0");
			jcbxAut.addItem("1");
			jcbxAut.addItem("2");
			jcbxAut.addItem("3");
		}
		return jcbxAut;
	}

	/**
	 *initializes jbtnUpdate	
	 * 	
	 * @return JButton
	 */
	private JButton getJbtnUpdate() {
		if (jbtnUpdate == null) {
			jbtnUpdate = new JButton();
			jbtnUpdate.setBounds(new Rectangle(31, 166, 133, 31));
			jbtnUpdate.setText("Update");
			
			
		}
		return jbtnUpdate;
	}

	/**
	 *initializes jbtnBack	
	 * 	
	 * @return JButton
	 */
	private JButton getJbtnBack() {
		if (jbtnBack == null) {
			jbtnBack = new JButton();
			jbtnBack.setBounds(new Rectangle(210, 166, 76, 33));
			jbtnBack.setText("Back");
			
		}
		return jbtnBack;
	}
	/**
	 * Set jcbxAut with index
	 * @param index set the jcbxAut to this index
	 */
	public void lsetcombo(int index)
	{
		jcbxAut.setSelectedIndex(index);
	}
	/**
	 * set jtxtUserName to st and disable it
	 * @param st text which will be display in jtxtUserName
	 */
	public void lsettxt(String st)
	{
		jtxtUserName.setText(st);
		jtxtUserName.setEnabled(false);
	}

} 
